// $Id: nodemesh.h 72 2004-12-02 15:03:28Z jonas $
#ifndef NODEMESH_H
#define NODEMESH_H

#include "nodevanilla.h"
#include "filemesh.h"
#include <map>

/**
 * Behaves as Vanilla except for the routing. Instead of just using standard
 * Freenet (vanilla) routing, Mesh keeps track of a file mesh for each node
 * it queries which contains fuzzy data about a neighbors file store. When no
 * file mesh is available for a node it falls back on vanilla routing.
 */
class NodeMesh : public NodeVanilla {
public:
	NodeMesh(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, float, float, FileHandler *);
	~NodeMesh();

	//bool addNeighbor(Node *, unsigned int);
	StoredFile *storeFile(File *, bool);
	bool routeFile(Node *, NodeRequestFileParameters *);
	void generateRequestOrderList(File *, std::list<KeyDistanceHelper> &);
	void setFileMesh(Node *, FileMesh *);
	int getFileMeshCount();

private:
	FileMesh *m_fileMesh;
	std::map<Node *, FileMesh *> m_fileMeshList;
};

#endif
